package com.java.comprehensive.design.test.first;

/**
 * @program: comprehensive-service
 * @description:
 * @author: 窦绍飞
 * @create: 2022-02-11 17:07
 **/
public class NewReleasePrice extends Price {
	@Override
	int getPriceCode() {
		return Movie.NEW_RELEASE;
	}

	@Override
	double getCharge(int daysRented) {
		if (daysRented > 2) {
			return ((daysRented - 2) * 1.5) + 2;
		}
		return 2;
	}

	@Override
	int getFrequentRenterPoints(int daysRented) {
		return (getPriceCode() == Movie.NEW_RELEASE) && daysRented > 1 ? 2 : 1;
	}
}
